from rest_framework import permissions

class IsSchoolMate(permissions.BasePermission):
    message = '你不是认证的校友'

    def has_permission(self, request, view):
        authentication_status =request.auth.payload.get('authentication_status')
        if authentication_status != '已认证':
            return False
        else:
            return True
